<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%--
	auth : Conner
	date : 2012-09-05
	desc : 添加角色
--%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/admin/common/css/style_sub.jsp"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=basePath%>js/lib/validation/css/livevalidation.css" />
<script type="text/javascript" src="<%=basePath%>js/lib/validation/livevalidation.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#rname")[0].focus();
		checkAll();
	});
	
	function checkAll(){
		var rname = new LiveValidation('rname',{ wait : 500},{onlyOnSubmit:true});
			rname.add( Validate.Presence, {failureMessage: "不能为空!"});
			rname.add( Validate.Length, { maximum: 6 } );

		var remark = new LiveValidation('remark',{ wait : 500},{onlyOnSubmit:true});
			remark.add( Validate.Presence, {failureMessage: "不能为空!"});
			remark.add( Validate.Length, { maximum: 13 } );
	}
</script>
</head>
<body>
	<div class="title">添加角色</div>
	<form action="<%=basePath %>basic/sys/role_add.action" id="form" method="post">
		<div class="editorTab">
			<table>
				<tbody>
					<tr>
						<th><font>*</font>所属子系统</th>
						<td>
							<select name="role.sub_id" class="downMenu">
								<option value="0">===请选择===</option>
								<s:iterator value="%{listSubSystem}">
									<option value="${id }">${name }</option>
								</s:iterator>
							</select>
						</td>
					</tr>
					<tr>
						<th><font>*</font>角色名称</th>
						<td>
							<input type="text" name="role.rname" id="rname" class="widStyle"/>
						</td>
					</tr>
					<tr>
						<th><font>*</font>启/停用</th>
						<td>
							<label><input type="radio" name="role.state" value="1" checked="checked"/>
							<img src="<%=basePath %>style/icons/ok.png" title="启用" alt="启用" align="absmiddle"/></label>&nbsp;&nbsp;&nbsp;&nbsp;
							<label><input type="radio" name="role.state" value="2"/>
							<img src="<%=basePath %>style/icons/pause.png" title="停用" alt="停用" align="absmiddle"/></label>
						</td>
					</tr>
					<tr>
						<th>备注</th>
						<td>
							<textarea name="role.remark" id="remark" rows="3" class="downMenu">无</textarea>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	
		<div class="infoTips">
			加"<font>*</font>"的为必选或必填项
		</div>
		
		<div class="btns">
			<span class="btn"><input type="submit" id="submitBtn" value="添加" /></span>
			<span class="btn">
				<input type="button" id="cancelBtn" value="返回" 
					onclick="javascript:window.history.back();"/>
			</span>
		</div>
	</form>
</body>
</html>
